package cn.getech.data.development.constant;

import lombok.Getter;

/**
 * @description: 数仓表类型
 * @author: wangzhaowen：kiss
 * @create: 2021/1/15 18:16
 * @version: 2021/1/15
 **/
@Getter
public enum StoreTableType {

    OFFLINE(1, "离线表"),
    ONLINE(2, "实时表");

    private Integer code;
    private String name;

    StoreTableType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static StoreTableType ObjOf(Integer status) {
        if (status == null) {
            return null;
        } else {
            for (StoreTableType s : StoreTableType.values()) {
                if (s.getCode().equals(status)) {
                    return s;
                }
            }
            return null;
        }
    }
}
